home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15373 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.2 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Dangling pointer?
  5. Date: Thu, 18 Apr 96 17:51:41 GMT
  6. Organization: none
  7. Message-ID: <829849901snz@genesis.demon.co.uk>
  8. References: <4l0r4b$jte@dewey.csun.edu> <fcusack-1604962132440001@mudskipper.cac.psu.edu> <4l33dcINN8ms@keats.ugrad.cs.ubc.ca>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <4l33dcINN8ms@keats.ugrad.cs.ubc.ca>
  15.            c2a192@ugrad.cs.ubc.ca "Kazimir Kylheku" writes:
  16.  
  17. >In article <fcusack-1604962132440001@mudskipper.cac.psu.edu>,
  18. >frank. <fcusack@tdx.org> wrote:
  19. >>In article <4l0r4b$jte@dewey.csun.edu>, kc44097@csun.edu (chen) wrote:
  20. >>
  21. >>>     What is "dangling pointer",can someone give me a defination and example?
  22. >>> Please e-mail me kc44097@huey.csun.edu
  23. >>> 
  24. >>
  25. >>It's the complement of a split infinitive. :)
  26. >
  27. >Actually it isn't. A there is nothing wrong with putting words between the "to"
  28. >and the verb.
  29.  
  30. It depends.
  31.  
  32. >In fact, it's the only place an adjective can go:
  33.  
  34. ???
  35.  
  36. >        "I want to quickly get this message out"
  37.  
  38. Quick is an adjective, quickly is an adverb.
  39.  
  40. >is perfectly grammatical.
  41.  
  42. It depends on the grammar rules you are using.
  43.  
  44. >It would be ungrammatical to put the "quickly" in
  45. >front of the "to" or after the "get". You could rewrite the sentence as "I want
  46. >to get this message out quickly", but that is a transformation.
  47.  
  48. In what sense? Certainly it's putting the word in a different place but you'd
  49. have to do that with any of the alternatives. It certainly shows that quickly
  50. *can* go somewhere else.
  51.  
  52. >Linguists take
  53. >the view that the syntax of the language is defined by how the speaker's use
  54. >it, not by the utterly empirically inadequate rules of grammar would have them
  55. >speak or write.
  56.  
  57. The rules for prose, or for that matter poetry can have significant
  58. differences to those of spoken language. They tend to be more formal, or
  59. perhaps spoken langage is just much looser in the application of the rules.
  60. French has different verb forms for written narrative.
  61.  
  62. >Most grammar texts don't even recognize the recursively
  63. >generative nature of sentence structure. So the next time someone criticizes
  64. >your infinitive, tell them to split!
  65.  
  66. It depends on what you're writing. Usenet tends to be more interactive,
  67. almost like a spoken language so I'd agree with you in that context.
  68.  
  69. >A somewhat better analogy to a dangling C pointer is the use of a reference
  70. >that is unresolved. For example, the use of a word like "he" or "it" without an
  71. >antecedent. That's not a syntactic error, of course---but neither is a dangling
  72. >pointer in C, and that's why any grammar error (legitimate or not) is a bad
  73. >analogy for it.
  74.  
  75. So you're talking about a pointer that doesn't hold a meaningful value.
  76. In C that can happen for example when the object being pointed to is
  77. destroyed e.g. after a call to free or when you reach the end of a
  78. automatic variable's scope.
  79.  
  80. -- 
  81. -----------------------------------------
  82. Lawrence Kirby | fred@genesis.demon.co.uk
  83. Wilts, England | 70734.126@compuserve.com
  84. -----------------------------------------
  85.